//
//  ZCmainCell.m
//  zctx
//
//  Created by Yi luqi on 15/10/7.
//  Copyright © 2015年 sanliang. All rights reserved.
//

#import "ZCInvolvedCell.h"
#import "ZCInvolvedModel.h"

@implementation ZCInvolvedCell

- (void)awakeFromNib {
    // Initialization code
    self.stateLable.textColor = [UIColor colorWithHexString:@"#03ab9e"];
    self.nameLable.textColor = [UIColor colorWithHexString:@"#404040"];
    self.contentLable.textColor = [UIColor colorWithHexString:@"#787878"];
    self.timeLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];
    self.chouMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.biaoMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.NumMoneyLable.textColor = [UIColor colorWithHexString:@"#000000"];
    self.yiLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];
    self.muLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];
    self.zhiLable.textColor = [UIColor colorWithHexString:@"#8a8a8a"];

    self.lineone.backgroundColor = RGB(236, 237, 238);
    self.linetwo.backgroundColor = RGB(236, 237, 238);
    
    self.hlineone.backgroundColor = RGB(236, 237, 238);
    self.hlinetwo.backgroundColor = RGB(236, 237, 238);
    
    
    self.chouweight.constant = (SCREEN_WIDTH-2)/3;
    self.biaoweight.constant =(SCREEN_WIDTH-2)/3;
    
    self.lineHeight.constant = 0.4;
    self.lineHeightwo.constant =0.5;
    
    self.iconImgView.layer.masksToBounds = YES;
    self.iconImgView.layer.cornerRadius = 25/2;

}

-(void)setMainModel:(ZCInvolvedModel *)mainModel{
    
    _mainModel = mainModel;
    
    self.usernameLable.text = mainModel.username;
    
    self.nameLable.text = mainModel.pjname;
    self.contentLable.text = mainModel.content;
    
    int timeInt =[mainModel.btime intValue];
    self.timeLable.text = [NSString stringWithFormat:@"%@ 发起",stringDataWithTimeInterval(timeInt)];
    self.biaoMoneyLable.text = [NSString stringWithFormat:@"%.0f",mainModel.emoney/100];
    self.chouMoneyLable.text =[NSString stringWithFormat:@"%.0f",[mainModel.finish floatValue]/100];
    self.NumMoneyLable.text = [NSString stringWithFormat:@"%@",mainModel.sponsorsCount];
    

    NSURL *url =[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",[NetworkManager strURLBasic],mainModel.thumb]];
    [self.ImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placehold_involved"]];
    
    
    if (mainModel.avatar.length>0) {
        [self.iconImgView sd_setImageWithURL:[NSURL URLWithString:mainModel.avatar] placeholderImage:[UIImage imageNamed:@"projectdetail_icon"]];
    }else{
        self.iconImgView.image = [UIImage imageNamed:@"projectdetail_icon"];
    }    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
